%script#service_template{type: 'text/x-handlebars-template'}
  %li
    .service-icon
      %img{src: 'icon.svg'}
    = link_to 'service',
              '/service/77',
              title: 'service-details',
              class: "status-loading"
    .actions
      = link_to 'edit',
                '/service/77',
                class: 'view-action',
                title: 'details'
      = link_to 'delete',
                '/service/77',
                class: 'delete-action',
                title: 'delete',
                method: :delete

%script#category_archetype{type: 'text/x-handlebars-template'}
  .category-panel
    %header
      %span.title
        {{name}}
      .actions
        %a{href: "/categories/{{id}}", class: 'edit-action'}
        %a{href: "/categories/{{id}}", class: 'delete-action'}
    = link_to 'Add a Service', '#', class: 'button-positive add-service', title: 'add', data: {:category => '{{id}}'}

.category-panel
  %header
    %span.title
      Category
    .actions
      %a{href: "/application-category/1", class: 'edit-action'}
  %ul.services
    %li
      .service-icon
        %img{src:''}
      =link_to 'Wordpress', '/applications/77/services/77', class: 'status-started'
      .actions
        =link_to 'edit', '/applications/77/services/77', class: 'view-action'
        %a.delete-action
  %a.add-service{:data => {:category => 'null'}}
    Add a Service

#add-service-form
  %p foo
  %p bar
  %p baz
  %input{ :type => 'text', :class => 'query-field' }
  .local-image-results
    .search-result-item.image-result
      .actions
        = form_tag '/applications/77/services' do
          = hidden_field_tag 'app[name]', 'Wordpress'
          = hidden_field_tag 'app[category]', 'null', class: 'category-form-field'
          = hidden_field_tag 'name', 'Wordpress'
          = hidden_field_tag 'from', 'Wordpress'
          = select_tag 'app[tag]',
            options_for_select(['latest']),
            data: {'loaded' => false},
            id: nil,
            class: 'image-tag-select'
          = button_tag 'Add to App', class: 'button-positive'
